import Vue from 'vue'
import Router from 'vue-router'
Vue.use(Router)

export const constRoutes = [
    // 首页
    {
        path: '/',
        name: 'index',
        component: () =>
            import('@/pages/index')
    },
    //汇创营
    {
        path: '/huichuangcamp',
        name: 'huichuangcamp',
        component: () =>
            import('@/pages/huichuangCamp')
    },
    //汇创投
    {
        path: '/huichuangtou',
        name: 'huichuangtou',
        component: () =>
            import('@/pages/huichuangtou')
    },
    //园区
    {
        path: '/park',
        name: 'park',
        component: () =>
            import('@/pages/park')
    },
    //园区详情
    {
        path: '/parkDetail',
        name: 'parkDetail',
        component: () =>
            import('@/pages/parkDetail')
    },

    //汇创业服务
    {
        path: '/service',
        name: 'service',
        component: () =>
            import('@/pages/service')
    },
    //汇创业空间
    {
        path: '/space',
        name: 'space',
        component: () =>
            import('@/pages/space')
    },
    //关于我们
    {
        path: '/aboutUs',
        name: 'aboutUs',
        component: () =>
            import('@/pages/aboutUs')
    },
    //资讯
    {
        path: '/news',
        name: 'news',
        component: () =>
            import('@/pages/news')
    },
    //资讯详情
    {
        path: '/newsDetail',
        name: 'newsDetail',
        component: () =>
            import('@/pages/newsDetail')
    },
    //数字孵化
    {
        path: '/digitaIncubation',
        name: 'digitaIncubation',
        component: () =>
            import('@/pages/digitaIncubation')
    },






]

let router = new Router({
    mode: 'history',
    routes: constRoutes,
    scrollBehavior(to, from, savedPosition) { // 解决vue页面之间跳转，页面不是在顶部的问题
        return { x: 0, y: 0 }
    }
})

router.afterEach(() => {
    window.scrollTo(0, 0)
})
export default router
